<template>
  <div class="max">
    <inputText v-model="input" placeholder="请输入手机号/账号/邮箱" @blur="notFocus" @focus="add" />
  </div>
</template>

<script lang="ts" setup>
import { onMounted, ref, provide } from "vue";
import inputText from "@/components/inputText.vue";

function add(params:any) {
  console.log('获取了焦点');
  
}
function notFocus(params:any) {
  console.log('失去焦点');
  
}
const input = ref("");
</script>
<style lang="scss" scoped>
.max {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  .input {
    position: relative;
    label {
      position: absolute;
      top: 19px;
      left: 30px;
      font-size: 22px;
      color: #636363;
      pointer-events: none;
      background: white;
      padding: 0 3px;
      transition: all cubic-bezier(0.4, 0.2, 0.6, 1.0) 0.15s;
    }
    input {
      border: 1px solid #c2c8d0;
      width: 400px;
      height: 70px;
      border-radius: 10px;
      padding: 0 30px;
      font-size: 22px;
      transition: all 0.15s;
      &:focus {
        border: 1px solid #10a37f;
        outline: none;
        
      }
     
    }
    input:focus+label {
        // transition: all 0.15s;
        position: absolute;
          top: -11px;
          left: 15px;
          font-size: 16px;
          color: #10a37f;
        }
  }
}
</style>
